package com.kakavr.base.log;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * 日志父类
 * @author gang.yang
 *
 */

public class BaseLog {
	Logger log = LogManager.getLogger(this.getClass().getName());
	private static BaseLog baseLog = new BaseLog();

	protected void debug(String message) {
		log.debug(getMessage(message));
	}

	protected void warn(String message) {
		log.warn(getMessage(message));
	}

	protected void info(String message) {
		log.info(getMessage(message));
	}

	protected void error(String message) {
		log.error(getMessage(message));
	}

	protected static void sdebug(String message) {
		baseLog.debug(message);
	}

	protected static void swarn(String message) {
		baseLog.warn(message);
	}

	protected static void sinfo(String message) {
		baseLog.info(message);
	}

	protected static void serror(String message) {
		baseLog.error(message);
	}

	private String getMessage(String message) {
		return this.getClass().toString() + ":" + message;
	}
}
